cmake_minimum_required(VERSION 3.5)

project(QtTcpMultithreadingTest0 VERSION 0.1 LANGUAGES CXX)

set(CMAKE_INCLUDE_CURRENT_DIR ON)

set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)

set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

find_package(QT NAMES Qt6 Qt5 COMPONENTS Widgets Network REQUIRED)
find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Widgets Network REQUIRED)

include_directories(${CMAKE_SOURCE_DIR}/src/QtTcpMultithreading)

file(GLOB SourceFiles ${SourceFileTypes})
add_executable(${PROJECT_NAME}
        ${SourceFiles}
        )

INSTALL(TARGETS ${PROJECT_NAME}
        RUNTIME DESTINATION bin
        ARCHIVE DESTINATION lib
        )

target_link_libraries(${PROJECT_NAME} PRIVATE QtTcpMultithreading Qt${QT_VERSION_MAJOR}::Widgets Qt${QT_VERSION_MAJOR}::Network)
#set_property(DIRECTORY ${CMAKE_BINARY_DIR} PROPERTY VS_STARTUP_PROJECT ./bin/ZEventServer.exe)
set_target_properties(${target} PROPERTIES VS_DEBUGGER_COMMAND QtTcpMultithreadingTest0)
